#ifndef SCOREBOARD_H_
#define SCOREBOARD_H_

#include "Assert.h"

#include <string>
#include <list>
#include <stdexcept>

using namespace std;

class Scoreboard {
public:
	static const unsigned int SIZE = 5;

	friend ostream & operator <<(ostream & outputStream, const Scoreboard & scoreboard);

	void addScore(const string & playerName, const int & moves) throw (invalid_argument);
	bool isTopScore(const int & moves) throw (invalid_argument);
private:
	struct Score {
		static bool compare(const Score & first, const Score & second);

		Score():
			playerName(""), moves(0) {
		}
		Score(const string & playerName, const int & moves):
			playerName(playerName), moves(moves) {
		}

		string playerName;
		int moves;
	};
	list<Score> scores;
};

#endif /* SCOREBOARD_H_ */
